<%--
  注册页面
  Author: ZheL2
  Date: 2023/12/12
  Version: 1.0
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="m" uri="/WEB-INF/tld/mytag.tld"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>注册 - 校园社团管理系统</title>
    <link rel="stylesheet" type="text/css" href="<c:url value='/resources/css/bootstrap.css'/>">
    <link rel="stylesheet" type="text/css" href="<c:url value='/resources/css/style.css' />">
    <script src="<c:url value='/resources/js/bootstrap.bundle.js'/> "></script>

</head>
<body>

    <div class="page-container">
    <!-- 顶部导航栏 -->
    <jsp:include page="homeHeader.jsp"/>

    <div class="container mt-5">
        <div class="row justify-content-center">
            <div class="col-lg-4 col-6 border rounded shadow" style=" background-color: #f2f2f2; padding: 20px; min-width: 450px">
                <h2>用户注册</h2><br>
                <form action="register" method="post">
                    <div class="form-group row  mb-3" >
                        <label for="username" class="col-3">账号:</label>
                        <div class="col-9">
                            <input type="text" class="form-control" id="username" name="username" required>
                        </div>
                    </div>
                    <div class="form-group row  mb-3">
                        <label for="nickname" class="col-3">昵称:</label>
                        <div class="col-9">
                            <input type="text" class="form-control" id="nickname" name="nickname" required>
                        </div>
                    </div>
                    <div class="form-group row  mb-3">
                        <label for="gender" class="col-3">性别:</label>
                        <div class="col-9">
                            <select class="form-control" id="gender" name="gender" required>
                                <option value="true">男</option>
                                <option value="false">女</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group row  mb-3">
                        <label for="gender" class="col-3">学院:</label>
                        <div class="col-9">
                            <select class="form-control" id="college" name="college" required>
                                <option value="软件学院">软件学院</option>
                                <option value="计算机学院">计算机学院</option>
                                <option value="法学院">法学院</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group row  mb-3">
                        <label for="password" class="col-3">密码:</label>
                        <div class="col-9">
                            <input type="password" class="form-control" id="password" name="password" required>
                        </div>
                    </div>
                    <div class="form-group row  mb-3">
                        <label for="password" class="col-3">确认密码:</label>
                        <div class="col-9">
                            <input type="password" class="form-control" id="confirmPassword" name="confirmPassword" required>
                        </div>
                    </div>
                    <!-- 如果注册失败 -->
                    <c:if test="${registerError}">
                        <div class="row justify-content-end">
                            <p style="color: red;">${registerResult}</p>
                        </div>
                    </c:if>

                    <div class="row">
                        <div class="col-3 d-flex justify-content-start">
                            <a href="/" class="btn btn-secondary">取消</a>
                        </div>
                        <div class="col-9 d-flex justify-content-end">
                            <button type="submit" class="col-9 btn btn-outline-primary w-100">注册</button>
                        </div>
                    </div>
                </form>
                <p class="mt-3">已经有账号？<a href="login">登录</a></p>
            </div>
        </div>
    </div>

    <footer class="fixed-bottom">
        <m:footer/>
    </footer>
</div>

</body>


</html>